import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import vuetify from './plugins/vuetify';

// icon
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import './assets/css/iconfont.css'
// 
import { frameInRoutes } from "./router/routers.js"
import {menuAside } from "@/menu/index.js"

// message
import Message from './components/Message/index.js'
Vue.prototype.$message = Message
Vue.config.productionTip = false
// 当前的 baseUrl
Vue.prototype.$baseUrl = process.env.BASE_URL

new Vue({
  router,
  store,
  vuetify,
  render: h => h(App),
  created(){
    // 处理路由 得到每一级的路由设置
    this.$store.commit('admin/page/init', frameInRoutes)
    this.$store.commit('admin/search/init', menuAside)
  },
  mounted(){
    this.$store.dispatch('admin/account/load')
    // 初始化全屏监听
    this.$store.dispatch('admin/fullscreen/listen')
    this.$store.commit('admin/ua/get')
  },
}).$mount('#app')